package parser;

import server.SimpleDB;
import storage.transaction.Transaction;

public class CreateIndexData extends ManipulateData {

	private String idxname, tblname, fldname;
	private boolean unique;

	public CreateIndexData(String idxname, String tblname, String fldname, boolean u) {
		this.idxname = idxname;
	      this.tblname = tblname;
	      this.fldname = fldname;
	      unique = u;
	}

	public String indexName() {
	      return idxname;
	   }
	
	public String tableName() {
	      return tblname;
	   }
	
	 public String fieldName() {
	      return fldname;
	   }
	 
	 public boolean isUnique() {
		   return unique;
	   }

		@Override
		public int execute(Transaction tx) {
			return SimpleDB.uplanner().executeCreateIndex(this, tx);
		}
}
